NEXT
·
UP
·
PREVIOUS
·
CONTENTS
·
INDEX
Next:
List processing
Up:
Induction for lists
Previous:
Proof:
Proof:
The initial step is to show that this proposition holds for the empty list,
[]
. From the definition of the function,
rev
(
rev
[]
) =
rev
[]
=
[]
as required.
Now assume that
rev
(
rev
t
)
=
t
and consider
h
::
t
.
LHS
=
rev
(
rev
(
h
::
t
))
=
rev
(
(
rev
t
)
@
[h]
)
[defn of
rev
]
=
(
rev
[h]
)
@
(
rev
(
rev
t
))
[interchange law]
=
[h]
@
t
[induction hypothesis and defn of
rev
]
=
h
::
t
[defn of @]
=
RHS
NEXT
·
UP
·
PREVIOUS
·
CONTENTS
·
INDEX
Next:
List processing
Up:
Induction for lists
Previous:
Proof: